package com.study.compose.coroutines

import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
import kotlinx.coroutines.runBlocking

/**
 * 开启10w个协程，每个协程延迟5秒后输出一个数字
 */
fun main() = runBlocking {

    var i = 0
    repeat(100000) {
        launch(Dispatchers.IO) {
            delay(5000)
            print("${Thread.currentThread().name}:${++i}、")
        }
    }
}